pub fn convert_base(num_str: &str, to_base: u32) -> String {
    let left_parenthesis = num_str.find('(').unwrap();
    let right_parenthesis = num_str.find(')').unwrap();
    let num = &num_str[..left_parenthesis];
    let from_base = num_str[left_parenthesis + 1..right_parenthesis]
        .parse::<u32>()
        .unwrap();
    let num = i64::from_str_radix(num, from_base).unwrap();
    // Convert the number to the target base
    from_radix(num, to_base)
}

fn from_radix(mut num: i64, radix: u32) -> String {
    let mut result = vec![];
    while num > 0 {
        let remainder = num % radix as i64;
        num = num / radix as i64;
        let ch = std::char::from_digit(remainder as u32, radix).unwrap();
        result.push(ch);
    }
    result.iter().rev().collect()
}
